package com.bdqn.demo.controller;

import com.bdqn.demo.pojo.Properties;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * HelloController
 *
 * @author LILIBO
 * @since 2021-11-19
 */
@Controller
public class TestController {

    @Value("${com.bdqn.name}")
    private String name;

    @Value("${com.bdqn.phone}")
    private String phone;

    @Resource
    private Properties properties;

    @ResponseBody
    @RequestMapping("/test")
    public String test() {
        String hi = "Hello, My name is " + properties.getName() + " , My phone is: " + properties.getPhone();
        System.out.println(hi);
        return hi;
    }
}
